package com.lebang.model.enums.buss;

/**
 * @Author: hwq
 * @Date: 2020/3/3 14:40
 * @Version 1.0
 */
public enum  TaskModel {
    JTRW("截图任务", 0),
    CPL_SDK("cpl游戏", 1),
    NEW_HAND("新手任务", 1),
    ;
    private String title;
    private int index;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    private TaskModel(String title, int index) {
        this.title = title;
        this.index = index;
    }

    public static TaskModel getByIndex(int index) {
        for (TaskModel e : TaskModel.values()) {
            if (e.index == index) {
                return e;
            }
        }
        return null;
    }

    public static TaskModel getByTitle(String title) {
        if (null == title) {
            return null;
        }
        for (TaskModel e : TaskModel.values()) {
            if (e.title.equals(title)) {
                return e;
            }
        }
        return null;
    }
}
